<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>模块化开发</title>
</head>

<body>

    <script type="module">
        // as 定义别名，定义别名后原名称不再可用
        // import { title as webTitle, web, getWeb } from './source.js'
        // console.log("title:", webTitle)
        // console.log("web:", web)
        // console.log("getWeb:", getWeb())

        // 导入使用default导出的内容
        // import source from './source.js'
        // console.log("title:", source.title)
        // console.log("web:", source.web)
        // console.log("getWeb:", source.getWeb())

        // 使用 * as 导入所有内容并起一个别名
        import * as source from './source.js'
        console.log("title:", source.title)
        console.log("web:", source.web)
        console.log("getWeb:", source.getWeb())
    </script>
</body>

</html>